package cn.wk.client;

import cn.wk.domain.LoginUser;
import cn.wk.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class AuthFeignFallbackFactory implements FallbackFactory<AuthFeign>{
    @Override
    public AuthFeign create(Throwable throwable) {
        return new AuthFeign() {
            @Override
            public AjaxResult addOrUpdate(LoginUser loginUser) {
                return AjaxResult.me().setSuccess(false).setMessage("auth feign调用失败");
            }
        };
    }
}
